import java.util.Scanner;

public class test20 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 直接转为stringbuffer 直接插入到对应的位置  4,672 倒过来加, 那就两次反转
        int n = in.nextInt();
        String str = String.valueOf(n);
        // 转格式
        StringBuffer sb = new StringBuffer();
        int length = str.length();
        for (int i = 0; i < length; i++) {
            sb.append(str.charAt(i));
            if ((length-i-1)%3==0&i!=length-1)
                sb.append(',');
        }
        System.out.println(sb);
    }
}
